<template>
        <!-- 编辑异常数值 -->
      <n-card class="work_card"  preset="card" closable aria-modal="true" @close="val.md_edityc = false">
          <!-- 标题 -->
          
          <template #header>编辑主控角色 {{ val.v_ycrole }} 异常值</template>
          <div class="workbg">
            <n-alert :show-icon="false"> 没有二专的角色选择None就行，BOSS如果异常值错误请联系猫燐修改。<br/>修改异常会实时修改本地数据（刷新页面恢复云端异常值）<br/>非专武暂时无法显示正确异常值（等待研究如何设计）</n-alert>
            <br/>
          <n-space>
          <n-space class="work_sp2">
            <span>本专异常类型：</span>
            <div class="dfc" style="gap:2px 3px;">
              <div v-for="item2,key2 in val.em3">
                <n-tag 
                style="
                --n-text-color: var(--n-title-text-color);
                "
                @click="val.v_edit_yc.ycl = item2"
                :bordered="!item2.includes(val.v_edit_yc.ycl)"
                type="warning">{{ item2 }}</n-tag>
              </div>
          </div>
          </n-space>
          <n-space class="work_sp2">
            <span>二专异常类型：</span>
            <div class="dfc" style="gap:2px 3px;">
              <div v-for="item2,key2 in val.em3">
                <n-tag 
                style="
                --n-text-color: var(--n-title-text-color);
                "
                @click="val.v_edit_yc.ycl2 = item2"
                :bordered="!item2.includes(val.v_edit_yc.ycl2)"
                type="warning">{{ item2 }}</n-tag>
              </div>
          </div>
          </n-space>
          </n-space>

          <br/>
          <n-space>
          <n-space class="work_sp2">
            <span>本专异常数值：</span>
            <n-input v-model:value="val.v_edit_yc.yc"></n-input>
          </n-space>
          <n-space class="work_sp2">
            <span>二专异常数值：</span>
            <n-input v-model:value="val.v_edit_yc.yc2"></n-input>
          </n-space>
          </n-space>
          
          <n-hr/>
          <n-space>
            <n-button type="warning" @click="ct.edityc(val.v_ycrole,val.v_edit_yc)">提交异常值</n-button> 
          </n-space>
          <n-hr/>

          <n-space class="work_sp2" v-if="val.v_edit_yc.ycl != 'none' && val.v_edit_yc.ycl != null">
            <span>本专异常参考：</span>
            <div v-for="item,key in val.byc">
              <el-tag class="el-tag--work_ycz">{{ val.bname[key] ?? key }} {{ ( item[val.v_edit_yc.ycl] * val.v_edit_yc.yc).toFixed(2) }} %</el-tag>

            </div>
          </n-space>
          <n-hr/>
          <n-space class="work_sp2" v-if="val.v_edit_yc.ycl2 != 'none' && val.v_edit_yc.ycl2 != null">
            <span>二专异常参考：</span>
            <div v-for="item,key in val.byc">
              <el-tag class="el-tag--work_ycz">{{ val.bname[key] ?? key }} {{ ( item[val.v_edit_yc.ycl2] * val.v_edit_yc.yc2 ).toFixed(2) }} %</el-tag>
          
            </div>
          </n-space>
        </div>
           
      </n-card>
</template>
<script>
export default {
  components: {
  },
  props: {
    val: {
      type: Object,
      required: true,
    },
    ct: {
      type: Object,
      required: true,
    },
  },
};
</script>